package com.zepher.springboot.mapper;

import com.zepher.springboot.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from user where username = #{username}")
    User selectByUsername(String username);

    List<User> selectAll(User user);

    @Select("select * from user where id = #{id}")
    User selectById(Integer id);

    void insert(User user);

    void update(User user);

    void delete(Integer id);

    @Select("select * from user where email = #{email}")
    User selectByEmail(String email);

    @Select("select * from user where phone = #{phone}")
    User selectByPhone(String phone);

    @Select("select * from user where id_card = #{idCard}")
    User selectByIdCard(String idCard);
}
